//
//  UIView+BaseBaseBusiness.h
//  LBBase
//
//  Created by Gary on 15/9/17

//  Copyright (c) 2015年 Lebo. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum ThinLineFaceAtDirection {
    ThinLineFaceAtDirectionNone = 0,    //细线面向的方向（保留的一边）
    ThinLineFaceAtDirectionLeft,
    ThinLineFaceAtDirectionRight,
    ThinLineFaceAtDirectionTop,
    ThinLineFaceAtDirectionBottom,
} ThinLineFaceAtDirection;

typedef enum : NSUInteger {
    AnimationTypeFade = 1,                   //淡入淡出
    AnimationTypePush,                       //推挤
    AnimationTypeReveal,                     //揭开
    AnimationTypeMoveIn,                     //覆盖
    AnimationTypeCube,                       //立方体
    AnimationTypeSuckEffect,                 //吮吸
    AnimationTypeOglFlip,                    //翻转
    AnimationTypeRippleEffect,               //波纹
    AnimationTypePageCurl,                   //翻页
    AnimationTypePageUnCurl,                 //反翻页
    AnimationTypeCameraIrisHollowOpen,       //开镜头
    AnimationTypeCameraIrisHollowClose,      //关镜头
    AnimationTypeCurlDown,                   //下翻页
    AnimationTypeCurlUp,                     //上翻页
    AnimationTypeFlipFromLeft,               //左翻转
    AnimationTypeFlipFromRight,              //右翻转
} AnimationType;

@interface UIView (BaseBusiness)

/**
 *  变为细线，宽度为0.5像素
 *
 *  @param lineColor 线的颜色
 *  @param direction 细线面向哪个方向
 */
- (void)becomeThinLine:(UIColor*)lineColor faceAtDirection:(ThinLineFaceAtDirection)direction;

#pragma mark - Animation

- (void)animate:(AnimationType)type subtype:(NSString *)subtype;

/**
 *  CATransition动画实现
 *
 *  @param type
 *  @param subtype 候选：kCATransitionFromLeft
 *                      kCATransitionFromBottom
 *                      kCATransitionFromRight
 *                      kCATransitionFromTop
 */
- (void)transitionWithType:(NSString *)type WithSubtype:(NSString *)subtype;

/**
 *  动画转换
 *
 *  @param transition
 */
- (void)animationTransition:(UIViewAnimationTransition)transition;

@end

@interface UIImageView (BaseBusiness)

- (void)loadImageUsingIndicator:(NSURL *)url placeholder:(UIImage *)placeholder;

@end

@interface UIButton (EnlargeEdge)
- (void)setEnlargeEdge:(CGFloat) size;
- (void)setEnlargeEdgeWithTop:(CGFloat) top right:(CGFloat) right bottom:(CGFloat) bottom left:(CGFloat) left;
@end
